Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pf's anchor to load the rules for nat and port forwarding #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fabianfreyer
Copy link

@fabianfreyer fabianfreyer commented Oct 1, 2017

Fixes #1

@@ -146,6 +146,28 @@ def load_module(module_name)
end
end

def check_or_create_default_pfconf(ui)
if execute(true, "test -s /etc/pf.conf") != 0
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguably, /etc/pf.conf should not be hardcoded here but maybe taken from the pf_rules rcvar.

if execute(true, "test -s /etc/pf.conf") != 0
ui.warn I18n.t("vagrant_bhyve.action.vm.boot.create_default_pfconf")

# probably this could be done in a nicer way with open and puts...
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll replace this with a File.open(...) block when I'm rebasing the next time.

pf_file.puts "set skip on #{bridge_name}"
check_or_create_default_pfconf(ui)
# set up bridge pf anchor
pf_bridge_conf = "/usr/local/etc/pf.#{bridge_name}.conf"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguably this should also be somewhere in @data_dir, as it's not really permanent configuration...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant